﻿Public Class BottomStripButton
  Implements MobilePrettyGui.iSlidingButtonStripItem

  Private _name As String = ""
  Private _visible As Boolean = True
  Private _clickRectangle As New Rectangle(0, 0, 0, 0)
  Private _mainBitmap As Bitmap = Nothing
  Private _mainBitmapRectangle As Rectangle = Nothing
  Private _highlightBitmap As Bitmap = Nothing
  Private _highlightBitmapRectangle As Rectangle = Nothing

  Private _ViewIndexIndex As Integer = -1

  Public Event SwitchToViewIndex(ByVal index As Integer)

  Public Sub New()
  End Sub

  Public Sub New(ByVal newName As String, ByRef newMainBitmap As Bitmap, ByRef newHighlightBitmap As Bitmap, ByVal newViewIndexIndex As Integer)
    Me._name = newName
    Me._mainBitmap = newMainBitmap
    Me._mainBitmapRectangle = New Rectangle(0, 0, newMainBitmap.Width, newMainBitmap.Height)
    Me._highlightBitmap = newHighlightBitmap
    Me._highlightBitmapRectangle = New Rectangle(0, 0, newHighlightBitmap.Width, newHighlightBitmap.Height)
    Me._ViewIndexIndex = newViewIndexIndex
  End Sub

  Public ReadOnly Property MainBitmap() As Bitmap
    Get
      Return Me._mainBitmap
    End Get
  End Property

  Public ReadOnly Property HighlightBitmap() As Bitmap
    Get
      Return Me._highlightBitmap
    End Get
  End Property

  Public Property Name() As String Implements MobilePrettyGui.iSlidingButtonStripItem.Name
    Get
      Return Me._name
    End Get
    Set(ByVal value As String)
      Me._name = value
    End Set
  End Property

  Public ReadOnly Property ActivatedFloatingIcon(ByVal rect As System.Drawing.Rectangle) As System.Drawing.Bitmap Implements MobilePrettyGui.iSlidingButtonStripItem.ActivatedFloatingIcon
    Get
      Return Nothing
    End Get
  End Property

  Public Property ClickRectangle() As System.Drawing.Rectangle Implements MobilePrettyGui.iSlidingButtonStripItem.ClickRectangle
    Get
      Return Me._clickRectangle
    End Get
    Set(ByVal value As System.Drawing.Rectangle)
      Me._clickRectangle = value
    End Set
  End Property

  Public Property ViewIndexIndex() As Integer
    Get
      Return Me._ViewIndexIndex
    End Get
    Set(ByVal value As Integer)
      Me._ViewIndexIndex = value
    End Set
  End Property

  Public Sub DrawSlidingButtonStripItem(ByVal g As System.Drawing.Graphics, ByVal rect As System.Drawing.Rectangle, ByVal isHighlighted As Boolean) Implements MobilePrettyGui.iSlidingButtonStripItem.DrawSlidingButtonStripItem
    If Me._mainBitmap IsNot Nothing Then
      g.DrawImage(Me._mainBitmap, rect, Me._mainBitmapRectangle, GraphicsUnit.Pixel)
    End If
  End Sub

  Public Sub DrawSlidingButtonStripItemOverlay(ByVal g As System.Drawing.Graphics, ByVal rect As System.Drawing.Rectangle) Implements MobilePrettyGui.iSlidingButtonStripItem.DrawSlidingButtonStripItemOverlay
    If Me._highlightBitmap IsNot Nothing Then
      g.DrawImage(Me._highlightBitmap, rect, Me._highlightBitmapRectangle, GraphicsUnit.Pixel)
    End If
  End Sub

  Public Sub OnItemSelected() Implements MobilePrettyGui.iSlidingButtonStripItem.OnItemSelected
    RaiseEvent SwitchToViewIndex(Me._ViewIndexIndex)
  End Sub

  Public Sub OnMouseDown() Implements MobilePrettyGui.iSlidingButtonStripItem.OnMouseDown

  End Sub

  Public Sub OnMouseEnter() Implements MobilePrettyGui.iSlidingButtonStripItem.OnMouseEnter

  End Sub

  Public Sub OnMouseLeave() Implements MobilePrettyGui.iSlidingButtonStripItem.OnMouseLeave

  End Sub

  Public Sub OnMouseUp() Implements MobilePrettyGui.iSlidingButtonStripItem.OnMouseUp

  End Sub

  Public Property Visible() As Boolean Implements MobilePrettyGui.iSlidingButtonStripItem.Visible
    Get
      Return Me._visible
    End Get
    Set(ByVal value As Boolean)
      Me._visible = value
    End Set
  End Property
End Class
